import VueRouter from 'vue-router'
// 路由切换:组件是注册在挂载具体路由文件内的
import About from '../pages/About.vue'
import Home from '../pages/Home.vue'
import News from '../pages/News.vue'
import Message from '../pages/Message.vue'
import Detail from '../pages/Detail.vue'

export default new VueRouter({
    // 易出错的配置变量名routers
    routes: [
        {
            path: '/about',
            component: About,
        },
        {
            name:'jia',
            path: '/home',
            component: Home,
            children: [
                {
                    // 嵌套路由路径无需/
                    path: 'news',
                    component: News
                },
                {
                    path: 'message',
                    component: Message,
                    children: [
                        {
                            // 套娃.. detaul==xiangqiang的意思
                            // name用于命名路由
                           name:'xiangqin',
                            path: 'detail',
                            component: Detail
                        }
                    ]
                }
            ]
        }
    ]
})